<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>本地存储</title>
</head>
<body>

欢迎,<span id="username"></span>

</body>
<script>

 var username= localStorage.getItem("username"); // 从本地文件中读取数据
 document.getElementById('username').innerText = username;

</script>
</html>